<?php

require_once 'vendor/autoload.php';

use WebSocket\Client;

$client = new Client("wss://lovestory-ceshi.dsgame.iqiyi.com:8689/");

for ($i = 0; $i < 5; $i++) {
    $client->send(json_encode(array('cmd' => 9999)));

    echo $client->receive().PHP_EOL;
}